_realname=iverilog
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=devel
pkgrel=1
pkgdesc="Icarus Verilog, a Verilog simulation tool (mingw-w64)"
arch=('any')
mingw_arch=('mingw64', 'ucrt64', 'clang64')
url="https://steveicarus.github.io/iverilog/"
license=('spdx:GPL-2.0-or-later')
depends=("${MINGW_PACKAGE_PREFIX}-cc-libs"
         "${MINGW_PACKAGE_PREFIX}-readline"
         "${MINGW_PACKAGE_PREFIX}-bzip2"
         "${MINGW_PACKAGE_PREFIX}-zlib")
makedepends=("gperf"
             "man-db"
             "${MINGW_PACKAGE_PREFIX}-cc"
             "${MINGW_PACKAGE_PREFIX}-autotools"
             "${MINGW_PACKAGE_PREFIX}-ghostscript")

source=()
sha256sums=()

build() {
  cd "${srcdir}"/../..
  sh autoconf.sh
  ./configure \
    --prefix="${MINGW_PREFIX}" \
    ${IVL_CONFIG_OPTIONS}
  make
}

check() {
  cd "${srcdir}"/../..
  make check
}

package() {
  cd "${srcdir}"/../..
  make DESTDIR="${pkgdir}" PACKAGE="${_realname}" install
}
